package com.myjava.linkedhashset;

import java.util.LinkedHashSet;
import java.util.Scanner;

public class demo2 {
    //从屏幕中输入元素，去除重复的元素
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串");
        String str=sc.nextLine();
        char [] arr= str.toCharArray();
        LinkedHashSet<Character> list= new LinkedHashSet();
        for(char i:arr){
        // Character  j=(Character)i;
         list.add(i);
        }
        System.out.println(list);
    }
}
